package com.guanyong.dao;

import com.guanyong.model.BannerListModel;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by mxk on 2017/6/3.
 */
public interface IBannerDaoMapper {

    @Select("select * from t_ad_bannerlist where f_id=#{id}")
    @ResultMap("BannerListResultMap")
    BannerListModel GetBannerModelById(Integer id);


    @Select("select * from t_ad_bannerlist order by f_intime desc")
    @ResultMap("BannerListResultMap")
    List<BannerListModel> GetBannerAllList();

    int insert(@Param(value = "record") BannerListModel record);

    int update(@Param(value = "record") BannerListModel record);

    @Delete(" DELETE FROM `t_ad_bannerlist` WHERE f_id=#{id} ")
    int delete(@Param(value = "id") Integer id);

    @Delete(" update  `t_ad_bannerlist` set  f_intime=now() WHERE f_id=#{id}")
    int UpdateTime(@Param(value = "id") Integer id);

    @Select("select * from t_ad_bannerlist order by f_intime desc LIMIT #{limit} ")
    @ResultMap("BannerListResultMap")
    List<BannerListModel> GetBannerList(@Param(value = "limit")int limit);
}
